﻿@model Himall.Web.Models.SiteSettingModel

<script src="~/Scripts/jquery.himallUpload.js"></script>
<script type="text/javascript">
    $(function () {
        $("#SiteName").focus();
    });
</script>
<div class="container">
    <ul class="nav nav-tabs-custom clearfix">
        <li class="active"><a>站点设置</a></li>
    </ul>
    @using (Html.BeginForm("Edit", "SiteSetting", FormMethod.Post))
    {
        <div class="form-horizontal form-pt0">

            <h3 class="table-hd">站点基本设置</h3>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="">网站名称：</label>
                <div class="col-sm-4">
                    @Html.EditorFor(item => item.SiteName, new { htmlAttributes = new { @class = "form-control input-sm" } })
                </div>
                <div class="col-sm-4">
                    <p class="help-default">显示在商城顶部欢迎信息等位置</p>
                </div>
            </div>

            <div class="form-group upload-img" id="Logo"></div>

            <div class="form-group upload-img" id="wxlogobox"></div>

            <div class="form-group upload-img" id="MemberLogo"></div>

            <div class="form-group upload-img" id="QRCode"></div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="">第三方流量统计代码：</label>
                <div class="col-sm-4">
                    @Html.TextAreaFor(item => item.FlowScript, new { @class = "form-control input-sm", rows = 5 })
                </div>
                <div class="col-sm-6">
                    <p class="help-default">在商城（前台）各个页面加上第三方流量统计代码，用于记录各页面访问情况</p>
                </div>
            </div>


            <h3 class="table-hd">SEO设置</h3>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="">Title：</label>
                <div class="col-sm-4">
                    @Html.EditorFor(item => item.Site_SEOTitle, new { htmlAttributes = new { @class = "form-control input-sm" } })
                </div>
                <div class="col-sm-4">
                    <p class="help-default"></p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="">Keywords：</label>
                <div class="col-sm-4">
                    @Html.EditorFor(item => item.Site_SEOKeywords, new { htmlAttributes = new { @class = "form-control input-sm" } })
                </div>
                <div class="col-sm-4">
                    <p class="help-default"></p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="">Description：</label>
                <div class="col-sm-4">
                    @Html.EditorFor(item => item.Site_SEODescription, new { htmlAttributes = new { @class = "form-control input-sm" } })
                </div>
                <div class="col-sm-4">
                    <p class="help-default"></p>
                </div>
            </div>
            <h3 class="table-hd">站点状态</h3>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="">是否关闭站点：</label>
                <div class="col-sm-8 form-control-static">
                    @Html.CheckBoxFor(item => item.SiteIsOpen) (勾选关闭站点后，前台和商家中心全部功能不能使用, 请您谨慎操作！)
                </div>
            </div>
            <h3 class="table-hd">会员注册</h3>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="">是否需要手机验证：</label>
                <div class="col-sm-8 form-control-static">
                    @Html.CheckBoxFor(item => item.MobileVerifOpen) (勾选手机验证后，会员注册需要经过手机验证！)
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <input type="button" id="Save" class="btn btn-primary" value="保 存">
                </div>
            </div>
        </div>

    }
</div>
<script>
    $('#Save').click(function () {
        var loading = showLoading();
        $.post('./Edit', $('form').serialize(), function (result) {
            loading.close();
            if (result.success) {
                $.dialog.tips('保存成功');
            }
            else
                $.dialog.errorTips('保存失败！' + result.msg);
        });
    });

    $(function () {
        $('#Logo').himallUpload({
            title: '网站Logo',
            imageDescript: '最佳尺寸：270*60  显示在商城头部、会员登录处等位置',
            displayImgSrc: '@Model.Logo',
            imgFieldName: "Logo",
            dataWidth: 8
        });

        $('#wxlogobox').himallUpload({
            title: '微信Logo',
            imageDescript: '建议上传100*100的图片,微信卡券使用',
            displayImgSrc: '@Model.WXLogo',
            imgFieldName: "WXLogo",
            dataWidth: 8
        });

        $('#MemberLogo').himallUpload({
            title: '卖家中心logo',
            imageDescript: '最佳尺寸：180*40  显示在卖家中心导航处',
            displayImgSrc: '@Model.MemberLogo',
            imgFieldName: "MemberLogo",
            dataWidth: 8
        });

        $('#QRCode').himallUpload({
            title: '微信二维码',
            imageDescript: '最佳尺寸：90*90  显示在商城底部',
            displayImgSrc: '@Model.QRCode',
            imgFieldName: "QRCode",
            dataWidth: 8
        });
    })

</script>

